Beginning BBC micro:bit: A Practical Introduction to micro:bit Development by Pradeeka Seneviratne

Beginning BBC micro:bit: A Practical Introduction to micro:bit Development by Pradeeka Seneviratne

Author:Pradeeka Seneviratne
Language: eng
Format: epub
Publisher: Apress
Published: 2018-09-25T16:00:00+00:00


Listing 5-7 shows the MicroPython code that can be used to detect the “face up” gesture . If it detects the “face up” gesture, a HAPPY image will display on the LED screen; otherwise, it will display an ANGRY image. The accelerometer.current_gesture() function returns the name of the gesture that you performed. Then it compares the returned gesture name with the “face up” string. If both are equal, a HAPPY face will display on the LED screen; otherwise, the screen will display a SAD image.

from microbit import *



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.